// ToolBarXP.h: interface for the CToolBarXP class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_TOOLBARXP_H__1B8E0F52_586F_47A0_AF36_CB4AE1D3EB17__INCLUDED_)
#define AFX_TOOLBARXP_H__1B8E0F52_586F_47A0_AF36_CB4AE1D3EB17__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

class CToolBarXP :	public CWindowImpl<CToolBarXP, CToolBarCtrl>,
					public CCustomDraw<CToolBarXP>										
{
	typedef CToolBarXP thisClass;
	typedef CWindowImpl<CToolBarXP, CToolBarCtrl> baseClass;
public:
	DECLARE_WND_CLASS(_T("ArtCommandBar"))
	BEGIN_MSG_MAP(thisClass)
	CHAIN_MSG_MAP(CCustomDraw<CToolBarXP>)
	END_MSG_MAP()

public:
    DWORD OnPrePaint(int idCtrl, LPNMCUSTOMDRAW lpNMCustomDraw);
    DWORD OnItemPrePaint(int idCtrl, LPNMCUSTOMDRAW lpNMCustomDraw);

	BOOL SubclassWindow(HWND hWnd, 
						LPCTSTR lpszResourceName, 
						COLORREF transparentColor = CLR_DEFAULT);	

protected:
	// Toolbar Helper APIs..
	HBITMAP		LoadColorBitmap(LPCTSTR lpszResourceName, HMODULE hInst, int* pNumcol);	
	BOOL		PaintHotButton(LPNMCUSTOMDRAW lpNMCustomDraw);
	void		PaintTBButton(LPNMCUSTOMDRAW pInfo);


	// Color modification related helpers..
	COLORREF	GetXpHighlightColor();
	COLORREF	MidColor(COLORREF colorA,COLORREF colorB);
	COLORREF	MixedColor(COLORREF colorA,COLORREF colorB);
	COLORREF	DarkenColorXP(COLORREF color);
	COLORREF	DarkenColor( long lScale, COLORREF lColor);
	COLORREF	LightenColor( long lScale, COLORREF lColor);
	COLORREF	MakeGrayAlphablend(HBITMAP hBitmap, int weighting, COLORREF blendcolor);
	int			NumScreenColors();
	WORD		NumBitmapColors(LPBITMAPINFOHEADER lpBitmap);	

	// implementation helpers
	void		_GetButton(int nIndex, TBBUTTON* pButton);
};

#endif // !defined(AFX_TOOLBARXP_H__1B8E0F52_586F_47A0_AF36_CB4AE1D3EB17__INCLUDED_)
